Text Translation (preview:2025-10-01)

2025/12/15 • 3 updated methods

GetSupportedLanguages (updated)
Description Gets the set of languages currently supported by other operations of the Translator.
Reference Link ¶

⚶ Changes

{
  "#id": "GetSupportedLanguages",
  "$responses": {
    "200": {
      "$properties": {
        "@added_e8305535368f426abc1bd6c43b2ba685": {
          "#name": "models",
          "Description": "LLM models supported.",
          "Required": false,
          "Type": "array",
          "$items": {
            "Type": "string"
          }
        },
        "@removed_d0f0632fe4294624b42e9f7b493f48de": {
          "#name": "dictionary",
          "Description": "Languages that support dictionary API.",
          "Required": false,
          "Type": "object"
        }
      }
    }
  }
}

⚼ Request

GET:  /languages
{
X-ClientTraceId: string ,
scope: string ,
Accept-Language: string ,
If-None-Match: string ,
api-version: string ,
}

⚐ Response (200)

{
$headers:
{
etag: string ,
x-requestid: string ,
}
,
$schema:
{
translation: object ,
transliteration: object ,
models:
[
string ,
]
,
}
,
}

⚐ Response (default)

{
$headers:
{
x-requestid: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
}
,
}
,
}
Translate (updated)
Description Translate Text
Reference Link ¶

⚶ Changes

{
  "#id": "Translate",
  "$parameters": {
    "body": {
      "Description": {
        "new": "Request data for translate.",
        "old": "Request body for the translate API."
      },
      "$properties": {
        "inputs": {
          "$properties": {
            "targets": {
              "Description": {
                "new": "Target language and translation configuration parameters.",
                "old": "Translate targets parameters"
              },
              "$properties": [
                {
                  "#name": "deploymentName",
                  "Description": {
                    "new": "Default is 'general', which uses NMT system.\n'abc-inc-gpt-4o', and 'abc-inc-gpt-4o-mini' are examples of deployment names which use GPT-4o uses or\nGPT-4o-mini model. 'gpt-4o' uses GPT-4o model.\n\n'' uses the custom NMT model tuned by customer.\n'best' system determines which is the best model to use for the request. This intelligence could be introduced\nin future. Customer should have deployed it in their resource.\n",
                    "old": "Default is \u2018general\u2019, which uses NMT system.\n\u2018abc-inc-gpt-4o\u2019, and \u2018abc-inc-gpt-4o-mini\u2019 are examples of deployment names which use GPT-4o uses or \nGPT-4o-mini model. \u2018gpt-4o\u2019 uses GPT-4o model. \n\n\u2018\u2019 uses the custom NMT model tuned by customer.\n\u2018best\u2019 system determines which is the best model to use for the request. This intelligence could be introduced\nin future. Customer should have deployed it in their resource.\n"
                  }
                },
                {
                  "#name": "referenceTextPairs",
                  "Description": {
                    "new": "Reference text pairs to generate adaptive customized translation.",
                    "old": "Reference sentence pairs to generate adaptive results."
                  },
                  "$items": {
                    "Description": {
                      "new": "Reference text pair to generate adaptive customized translation.",
                      "old": "Reference sentence pair."
                    }
                  }
                }
              ]
            }
          }
        }
      }
    }
  },
  "$responses": {
    "200": {
      "$properties": {
        "value": {
          "$properties": {
            "translations": {
              "$properties": [
                {
                  "#name": "sourceCharacters",
                  "Description": {
                    "new": "An integer indicating the number of characters in the source text string",
                    "old": "An interger indicating the number of characters in the source text string"
                  }
                },
                {
                  "#name": "instructionTokens",
                  "Description": {
                    "new": "An integer indicating the number of tokens used in generating the translated text",
                    "old": "An interger indicating the number of tokens used in generating the translated text"
                  }
                },
                {
                  "#name": "sourceTokens",
                  "Description": {
                    "new": "An integer indicating the number of tokens used in the source sentence",
                    "old": "An interger indicating the number of tokens used in the source sentence"
                  }
                },
                {
                  "#name": "responseTokens",
                  "Description": {
                    "new": "An integer indicating the number of tokens used in the translation response",
                    "old": "An interger indicating the number of tokens used in the translation response"
                  }
                },
                {
                  "#name": "targetTokens",
                  "Description": {
                    "new": "An integer indicating the number of tokens used in the target sentence",
                    "old": "An interger indicating the number of tokens used in the target sentence"
                  }
                }
              ]
            }
          }
        }
      }
    }
  }
}

⚼ Request

POST:  /translate
{
X-ClientTraceId: string ,
api-version: string ,
body:
{
inputs:
[
{
text: string ,
script: string ,
language: string ,
textType: enum ,
targets:
[
{
language: string ,
script: string ,
profanityAction: enum ,
profanityMarker: enum ,
deploymentName: string ,
allowFallback: boolean ,
grade: string ,
tone: string ,
gender: string ,
adaptiveDatasetId: string ,
referenceTextPairs:
[
{
source: string ,
target: string ,
}
,
]
,
}
,
]
,
}
,
]
,
}
,
}

⚐ Response (200)

{
$headers:
{
x-requestid: string ,
x-metered-usage: integer ,
x-mt-system: string ,
}
,
$schema:
{
value:
[
{
detectedLanguage:
{
language: string ,
score: number ,
}
,
translations:
[
{
language: string ,
sourceCharacters: integer ,
instructionTokens: integer ,
sourceTokens: integer ,
responseTokens: integer ,
targetTokens: integer ,
text: string ,
}
,
]
,
}
,
]
,
}
,
}

⚐ Response (default)

{
$headers:
{
x-requestid: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
}
,
}
,
}
Transliterate (updated)
Description Transliterate Text
Reference Link ¶

⚶ Changes

{
  "#id": "Transliterate",
  "$parameters": {
    "body": {
      "Description": {
        "new": "Request data for transliterate.",
        "old": "Request body for the transliterate API."
      }
    }
  }
}

⚼ Request

POST:  /transliterate
{
X-ClientTraceId: string ,
language: string ,
fromScript: string ,
toScript: string ,
api-version: string ,
body:
{
inputs:
[
{
text: string ,
}
,
]
,
}
,
}

⚐ Response (200)

{
$headers:
{
x-requestid: string ,
}
,
$schema:
{
value:
[
{
text: string ,
script: string ,
}
,
]
,
}
,
}

⚐ Response (default)

{
$headers:
{
x-requestid: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
}
,
}
,
}